local scene = gamestate.new()

local ui = {
	{text = "经典模式"},
	{text = "自定模式"},
}

local x = 200
local y = 200
local w = 200
local h = 50
local off = 20

function scene:enter(from,game)
	self.game = game
	local sw,sh = love.graphics.getDimensions()
	x = sw*GlobalScale/2 - w/2
end

function scene:update(dt)
	love.graphics.setFont(texture.font)	
	suit.Label("本地游戏",x,y-100,w,h)
	local offy = 0
	for i = 1,2 do
	    local b = ui[i]
	    local r = suit.Button(b.text,b,x,y+offy,w,h)
	    if r.entered then
	        sound:play("hover")
	    end
	    if r.hit then
			if i == 1 then
				gamestate.switch(gameState.classicgame)
			else
				gamestate.switch(gameState.localgame)
			end
	    end
		offy = offy + (h + off)
	end
  	self.game:update(dt)
end

function scene:draw()
	self.game:draw()
	suit.draw()
end

function scene:keypressed(k)
	if k == "escape" then
		gamestate.switch(gameState.title,self.game)
	end
end

return scene